class People {
    
    // 构造函数：使用new创建类的新实例的时候调用
    constructor(name,age,sex) {
        // this：指向当前实例（上面用new创建的新实例）
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    nationality = "中华人民共和国";

    sayHello = function() {
        console.log(this.name + `说：“你好”`);
    }

}

let ckd = new People("陈科地",20,"男");
ckd.sayHello();
console.log(ckd.nationality);

let nzx = new People("聂仔欣",20,"男");
nzx.sayHello();
console.log(nzx.nationality);
